home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
STREAMS
/
STRMCOPY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-08-14
|
1KB
|
29 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; moving data between streams; simple file copying
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBIO;
var FirstStream, SecondStream : StreamObjectPointerType; Storage : string;
begin
FirstStream := New (FileStreamObjectPointerType, Initialize (ParamStr(1), 100));
SecondStream := New (FileStreamObjectPointerType, Initialize (ParamStr(2), 100));
FirstStream^.MoveOut (SecondStream, FirstStream^.Size);
{ The above MoveOut call could be replaced with the following;
Storage[0] := #255;
while not FirstStream^.IsEnd do begin
FirstStream^.Read (Storage[1], 255);
SecondStream^.Write (Storage[1], FirstStream^.LastTransfer);
end; }
FirstStream^.Free; SecondStream^.Free;
end.